<%@ page language="java"  contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Post</title>

<script type="text/javascript">
	function send1() {
  		var xmlHttp = new XMLHttpRequest();
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
				alert(xmlHttp.responseText);
			}
		};
		xmlHttp.open("POST", "/ajaxTest/AjaxPostTestServlet", true);
		xmlHttp.setRequestHeader("Content-Type",
				"application/x-www-form-urlencoded");
		xmlHttp.send("username=linshuo");  
	}	
	
	window.onload = function() {//文档加载完毕后执行
	}

</script>
</head>

<body>
	<h1>这是一个Ajax的Post测试</h1>
	<br />
	<button id="btn" onclick="send1();">button2</button>

</body>

</html>